import 'package:flutter/material.dart';
import 'package:flutter_app/DetialPage.dart';
import 'package:flutter_app/TstExpanded.dart';
import 'package:flutter_app/TstNotification.dart';
import 'package:flutter_app/TstTextField.dart';

class OnePage extends StatelessWidget {
  var backData;

  @override
  Widget build(BuildContext context) => Scaffold(
          body: Column(children: <Widget>[
        RaisedButton(
          child: Text('跳转'),
          onPressed: () {
            print('点.....');
            Navigator.push(context, MaterialPageRoute(builder: (context) {
              return DetialPage();
            })).then((value) {
              //返回值

              backData = value;
              print(value);
            });
          },
          textColor: Color(0xffffffff),
          color: Color(0xFF1E88E5),
          highlightColor: Color(0xFF42A5F5),
        ),
        Text('接收返回值:$backData'),
        Expanded(
          child: Container(
            height: 100,
            child: ListView(
              scrollDirection: Axis.vertical,
              children: <Widget>[
                Card(
                  child: ListTile(
                    title: Text('Expanded、Flexible'),
                    subtitle:
                        Text('Expanded 相当于Android中的 weight 权重,Flexible 区别不大 '),
                    onTap: () {
                      Navigator.push(context,
                          MaterialPageRoute(builder: (context) {
                        return TstExpaned();
                      }));
                    },
                  ),
                ),
                Card(
                  child: ListTile(
                    title: Text('NotificationListener'),
                    subtitle: Text('NotificationListener 事件监听 '),
                    onTap: () {
                      Navigator.push(context,
                          MaterialPageRoute(builder: (context) {
                        return TstNotification();
                      }));
                    },
                  ),
                ),
                Card(
                  child: ListTile(
                    title: Text(''),
                    subtitle: Text('TextField  输入框 '),
                    onTap: () {
                      Navigator.push(context,
                          MaterialPageRoute(builder: (context) {
                        return TstTextField();
                      }));
                    },
                  ),
                ),
                Card(
                  child: ListTile(
                    title: Text('TextField'),
                    subtitle: Text('TextField  输入框 '),
                    onTap: () {
                      Navigator.push(context,
                          MaterialPageRoute(builder: (context) {
                        return TstTextField();
                      }));
                    },
                  ),
                ),
              ],
            ),
          ),
        ),
      ]));
}
